#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define N 100010

using namespace std;

int n,m;
int l,r,k;
ll arr[N];
ll dp[N];

void solve()
{
    cin>>n>>m;
    for(int i = 1;i<=n;++i)
    {
        cin>>arr[i];
    }
    while(m--)
    {
        cin>>l>>r>>k;
        dp[l]+=k;
        dp[r+1]-=k;
    }
    for(int i = 1;i<=n;++i)
    {
        dp[i]+=dp[i-1];
        arr[i]+=dp[i];
    }
    for(int i = 1;i<=n;++i)
    {
        cout<<arr[i]<<' ';
    }
    
}

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    solve();
    return 0;
}
